﻿using System;
using System.Net.Http;
using System.Windows.Forms;
using 易发车网.Pages;

namespace 易发车网
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            AppData.ReadUserSet();
            // if (!Check())
            // {
            //     return;
            // }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMain());
        }

        static bool Check()
        {
            try
            {
                var x = new HttpClient();
                var txt = x.GetStringAsync("https://controller-1258897520.cos.ap-chengdu.myqcloud.com/Appid_001").Result;
                if (txt != "1")
                {
                    MessageBox.Show("程序自檢查出錯,請聯係郵箱:2392559788@qq.com");
                    // Application.Exit();
                    return false;
                }
                return true;
            }
            catch
            {
                MessageBox.Show("程序自檢查出錯,請聯係郵箱:2392559788@qq.com");
                //Application.Exit();
                return false;
            }
        }
    }
}
